import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PlatManageComponent } from './plat-manage.component';
import { TeacherComponent } from './teacher/teacher.component';
import { RouterModule, Routes } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { ClassManageComponent } from './class-manage/class-manage.component';
import { ClassMajorTreeComponent } from './class-major-tree/class-major-tree.component';
import { StudentComponent } from './student/student.component';
import { DictionaryComponent } from './dictionary/dictionary.component';
import { DepartmentManageComponent } from './department-manage/department-manage.component';
import { RolesComponent } from './roles/roles.component';
import { MenuComponent } from './menu/menu.component';
import { RoomManageComponent } from './room-manage/room-manage.component';
import { ShareModule } from '../../share/share.module';
import { DeviceManageComponent } from './device-manage/device-manage.component';
import { LoginActivate } from '../../core/auth/login.activate';
import { SemesterManageComponent } from './semester-manage/semester-manage.component';
import { NewsComponent } from './news/news.component';
import { LessonManageComponent } from './lesson-manage/lesson-manage.component';
import { UMeditorModule } from 'ngx-umeditor';
import { LogsComponent } from './logs/logs.component';
import { AppVersionComponent } from './app-version/app-version.component';
import {BigscreenManageComponent} from './bigscreen-manage/bigscreen-manage.component';
import { DeptSupervisionComponent } from './dept-supervision/dept-supervision.component';
import { SchoolSupervisionComponent } from './school-supervision/school-supervision.component';
import { DataDealComponent } from './data-deal/data-deal.component';
import {DeptMngComponent} from './dept-mng/dept-mng.component';
const routes: Routes = [
  {
    path: '', component: PlatManageComponent, children: [
      {
        path: 'teacher',
        component: TeacherComponent,
        data: {
          breadcrumb: '教师管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'student',
        component: StudentComponent,
        data: {
          breadcrumb: '学生管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'class-manage',
        component: ClassManageComponent,
        data: {
          breadcrumb: '班级管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'department-manage',
        component: DeptMngComponent,
        data: {
          breadcrumb: '部门管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'semester-manage',
        component: SemesterManageComponent,
        data: {
          breadcrumb: '学期管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'lesson-manage',
        component: LessonManageComponent,
        data: {
          breadcrumb: '课节管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'room',
        component: RoomManageComponent,
        data: {
          breadcrumb: '房间管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'device',
        component: DeviceManageComponent,
        data: {
          breadcrumb: '设备管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'menu',
        component: MenuComponent,
        data: {
          breadcrumb: '菜单管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'roles',
        component: RolesComponent,
        data: {
          breadcrumb: '角色管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'news',
        component: NewsComponent,
        data: {
          breadcrumb: '消息管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'dictionary',
        component: DictionaryComponent,
        data: {
          breadcrumb: '字典管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'logs',
        component: LogsComponent,
        data: {
          breadcrumb: '系统日志'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'app-version',
        component: AppVersionComponent,
        data: {
          breadcrumb: 'app版本管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'bigscreen-manage',
        component: BigscreenManageComponent,
        data: {
          breadcrumb: '大屏管理'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'dept-supervision',
        component: DeptSupervisionComponent,
        data: {
          breadcrumb: '系部督导'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'school-supervision',
        component: SchoolSupervisionComponent,
        data: {
          breadcrumb: '校级督导'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'data-deal',
        component: DataDealComponent,
        data: {
          breadcrumb: '数据维护'
        },
        canActivate: [LoginActivate]
      },
      {
        path: '', redirectTo: 'teacher', pathMatch: 'full'
      },
      {
        path: '**', component: TeacherComponent
      }
    ]
  }
];

@NgModule({
  declarations: [
    PlatManageComponent,
    TeacherComponent,
    StudentComponent,
    DictionaryComponent,
    ClassManageComponent,
    ClassMajorTreeComponent,
    DepartmentManageComponent,
    SemesterManageComponent,
    RolesComponent,
    MenuComponent,
    RoomManageComponent,
    DeviceManageComponent,
    NewsComponent,
    LessonManageComponent,
    LogsComponent,
    AppVersionComponent,
    BigscreenManageComponent,
    DeptSupervisionComponent,
    SchoolSupervisionComponent,
    DeptMngComponent,
    DataDealComponent
  ],
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule,
    ShareModule,
    RouterModule.forChild(routes),
    UMeditorModule.forRoot(),
  ],
  exports: [
    RouterModule,
    StudentComponent
  ]
})
export class PlatManageModule {
}
